home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / AppleTalk Remote access / Scripts ARA ƒ / GV PP Gold with ATO < prev    next >
Encoding:
Text File  |  1994-06-29  |  6.6 KB  |  357 lines  |  [mlts/slnk]

  1. !
  2. ! AppleTalk Remote Access Script
  3. ! For use with Global Village PowerPort/GOLD /SILVER and /BRONZE
  4. !
  5. ! 6/21/92  AN   Added "pause 30" right after @LABEL 30 to fix a problem
  6. !               with the PowerBook hanging when AUTO_ANSWER was selected.
  7. !               Also changed all &F strings to &F&C1&D1.
  8. ! 6/13/92  AN   Always save &C1&D1 to NVRAM in Bronze
  9. !          AN   Fixed bug where PowerPort/Bronze was not being recognized
  10. ! 6/06/92  LAL  ORIGINAL RELEASE
  11. ! 11/30/92 CTC Changed script to TelePort format.
  12. !
  13. !
  14. @ORIGINATE
  15. @ANSWER
  16. !
  17. ! Talk to the modem at 2400 bps.
  18. !
  19. serreset 2400, 0, 8, 1
  20. !
  21. ! First recall the factory configuration
  22. !
  23. settries 0
  24. matchclr
  25. @LABEL 1
  26. matchstr 1 3 "OK\13\10"
  27. write "AT&F&C1\13"
  28. matchread 30
  29. inctries
  30. iftries 2 59
  31. jump 1
  32. !
  33. ! Which PowerPort is in use?  High Speed (961) or Low Speed (242)?
  34. !
  35. @LABEL 3
  36. Flush
  37. pause 10
  38. matchclr
  39. matchstr 1 68 "242\13\10\13\10"
  40. matchstr 2  4 "961\13\10\13\10"
  41. matchstr 3  4 "1442\13\10\13\10"
  42. write "ATI0\13"
  43. matchread 60
  44. note "Not a Global Village PowerPort." 2
  45. jump 59
  46. !
  47. ! PowerPort Silver or Gold Continues Here
  48. !
  49. settries 0
  50. @LABEL 4
  51. note "Initializing high speed PowerPort..." 2
  52. !
  53. ! Talk to the modem at 19,200 bps.  
  54. !
  55. serreset 19200, 0, 8, 1
  56. !
  57. ! &f   - recall factory settings
  58. ! \q3  - Use RTS/CTS flow control in full-duplex mode
  59. ! \k0  - Enter command state but do not send break
  60. ! \j0  - Disable port rate adjust
  61. ! S0=0 - Don't answer calls
  62. ! E0   - Turn command echo off
  63. ! \n5  - enable v.42LAPM autoreliable
  64. ! %c0  - turn off MNP5 compression
  65. !
  66. HSReset 0 1 0 0 0 1
  67. settries 0
  68. matchclr
  69. @LABEL 5
  70. matchstr 1 6 "OK\13\10"
  71. write "AT&f\\k0\\j0\\q3e0s0=0\n5%c0\13"
  72. matchread 50
  73. inctries
  74. iftries 2 59
  75. jump 5
  76. !
  77. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  78. !
  79. @LABEL 6
  80. ifstr 2 8 "1"
  81. pause 5
  82. matchstr 1 8 "OK\13\10"
  83. write "ATM0\13"
  84. matchread 30
  85. jump 59
  86. !
  87. ! The modem is ready so enable answering, or originate a call
  88. !
  89. @LABEL 8
  90. pause 5
  91. ifANSWER 30
  92. note "Issuing ATO.  Make sure you hear a carrier tone. " 2
  93. write "ATO\13"
  94. !
  95. @LABEL 9
  96. matchstr 1  11 "CONNECT 1200\13\10"
  97. matchstr 2  12 "CONNECT 2400\13\10"
  98. matchstr 3  13 "CONNECT 4800\13\10"
  99. matchstr 4  19 "CONNECT 7200\13\10"
  100. matchstr 5  14 "CONNECT 9600\13\10"
  101. matchstr 6  20 "CONNECT 12000\13\10"
  102. matchstr 7  18 "CONNECT 14400\13\10"
  103. matchstr 8  50 "NO CARRIER\13\10"
  104. matchstr 9  50 "ERROR\13\10"
  105. matchstr 10 52 "NO DIAL TONE\13\10"
  106. matchstr 11 53 "BUSY\13\10"
  107. matchstr 12 54 "NO ANSWER\13\10"
  108. matchread 700
  109. jump 59
  110. !
  111. ! Notice that all we do for different connect speeds is issue a 
  112. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  113. ! to 19,200 bps so we don't want to reset the serial speed after we connect.
  114. ! CommunicatingAt tells ARA what the actual line speed is so that it
  115. ! can set it's timers appropriately.  I guess your performance would be
  116. ! sub-optimal if you don't set this...
  117. !
  118. @LABEL 11
  119. note "Communicating at 1200 bps." 2
  120. CommunicatingAt 1200
  121. jump 15
  122. !
  123. @LABEL 12
  124. note "Communicating at 2400 bps." 2
  125. CommunicatingAt 2400
  126. jump 15
  127. !
  128. @LABEL 13
  129. note "Communicating at 4800 bps." 2
  130. CommunicatingAt 4800
  131. jump 15
  132. !
  133. @LABEL 19
  134. note "Communicating at 7200 bps." 2
  135. CommunicatingAt 7200
  136. jump 15
  137. !
  138. @LABEL 14
  139. note "Communicating at 9600 bps." 2
  140. CommunicatingAt 9600
  141. jump 15
  142. !
  143. @LABEL 20
  144. note "Communicating at 12000 bps." 2
  145. CommunicatingAt 12000
  146. jump 15
  147. !
  148. @LABEL 18
  149. note "Communicating at 14400 bps." 2
  150. CommunicatingAt 14400
  151. jump 15
  152. !
  153. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  154. ! command below )
  155. !
  156. @LABEL 15
  157. HSReset 0 1 0 0 0 1 
  158. ifANSWER 16
  159. pause 30
  160. @LABEL 16
  161. exit 0
  162. !
  163. ! @ANSWER
  164. ! Set up the modem to answer
  165. !
  166. @LABEL 30
  167. write "ATS0=1\13"
  168. matchstr 1 31 "OK\13\10"
  169. matchread 30
  170. jump 59
  171. !
  172. @LABEL 31
  173. matchstr 1  32 "RING\13\10"
  174. matchstr 2  11 "CONNECT 1200\13\10"
  175. matchstr 3  12 "CONNECT 2400\13\10"
  176. matchstr 4  13 "CONNECT 4800\13\10"
  177. matchstr 5  19 "CONNECT 7200\13\10"
  178. matchstr 6  14 "CONNECT 9600\13\10"
  179. matchstr 7  20 "CONNECT 12000\13\10"
  180. matchstr 8  18 "CONNECT 14400\13\10"
  181. matchstr 9  50 "NO CARRIER\13\10"
  182. matchstr 10 50 "ERROR\13\10"
  183. matchstr 11 52 "NO DIAL TONE\13\10"
  184. matchstr 12 53 "BUSY\13\10"
  185. matchstr 13 54 "NO ANSWER\13\10"
  186. matchread 700
  187. jump 31
  188. !
  189. @LABEL 32
  190. userhook 1
  191. note "Answering phone..." 2
  192. jump 31
  193. !
  194. ! 50: error messages
  195. !
  196. @LABEL 50
  197. exit -6021
  198. !
  199. @LABEL 52
  200. exit -6020
  201. !
  202. @LABEL 53
  203. exit -6022
  204. !
  205. @LABEL 54
  206. exit -6023
  207. !
  208. @LABEL 59
  209. exit -6019
  210. !
  211. ! Hang up the modem
  212. !
  213. @HANGUP
  214. @LABEL 60
  215. settries 0
  216. serreset 19200, 0, 8, 1
  217. HSReset 0 1 0 0 0 1
  218. @LABEL 61
  219. !
  220. SBreak
  221. pause 20
  222. Flush               ! prevent disconnect garbage
  223. write "\13"         ! start on a clean line
  224. @LABEL 96
  225. matchclr
  226. matchstr 1 97 "OK\13\10"
  227. write "AT\13"
  228. matchread 30
  229. inctries
  230. iftries 3 59
  231. jump 96
  232. @LABEL 97
  233. settries 0
  234. @LABEL 98
  235. matchclr
  236. matchstr 1 62 "OK\13\10"
  237. matchstr 2 62 "NO CARRIER\13\10"
  238. write "ATH\13"
  239. matchread 100
  240. inctries
  241. iftries 3 59
  242. jump 98
  243. @LABEL 62
  244. settries 0
  245. !
  246. ! recall the factory settings. (see note at top of script)
  247. !
  248. @LABEL 63
  249. matchclr
  250. matchstr 1 65 "OK\13\10"
  251. pause 15
  252. write "AT&f&C1\\V2w1\\k0\\j0\\q3e0s0=0\n5%c0\13"
  253. matchread 50
  254. inctries
  255. iftries 3 59
  256. jump 63
  257. !
  258. @LABEL 65
  259. exit 0
  260. !
  261. !
  262. !
  263. ! ------------------- POWERPORT/BRONZE -------------------
  264. !
  265. ! PowerPort Bronze Continues Here
  266. !
  267. @LABEL 68
  268. note "Initializing PowerPort/Bronze..." 2
  269. matchclr
  270. matchstr 1 69 "OK\13\10"
  271. write "AT&C1&D1&W0&W1\13"
  272. pause 5
  273. matchread 30
  274. jump 59
  275. !
  276. ! Turn off local echo, ignore NO DIALTONE and BUSY
  277. !
  278. @LABEL 69
  279. matchclr
  280. matchstr 1 70 "OK\13\10"
  281. write "ATE0X3S0=0\13"
  282. pause 5
  283. matchread 30
  284. jump 59
  285. !
  286. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  287. !
  288. @LABEL 70
  289. ifstr 2 71 "1"
  290. pause 5
  291. matchstr 1 71 "OK\13\10"
  292. write "ATM0\13"
  293. matchread 30
  294. jump 59
  295. !
  296. ! The modem is ready so enable answering, or originate a call
  297. !
  298. @LABEL 71
  299. pause 5
  300. ifANSWER 100
  301. note "Dialing ^1" 3
  302. write "ATDT^1\13"
  303. !
  304. matchstr  1 72 "CONNECT 1200\13\10"
  305. matchstr  2 73 "CONNECT 2400\13\10"
  306. matchstr  3 50 "NO CARRIER\13\10"
  307. matchstr  4 50 "ERROR\13\10"
  308. matchstr  5 52 "NO DIALTONE\13\10"
  309. matchstr  6 53 "BUSY\13\10"
  310. matchstr  7 54 "NO ANSWER\13\10"
  311. matchread 700
  312. jump 59
  313. !
  314. @LABEL 72
  315. note "Communicating at 1200 bps." 2
  316. serreset 1200, 0, 8, 1
  317. jump 75
  318. !
  319. @LABEL 73
  320. note "Communicating at 2400 bps." 2
  321. serreset 2400, 0, 8, 1
  322. !
  323. !
  324. @LABEL 75
  325. ifANSWER 76
  326. pause 30
  327. @LABEL 76
  328. exit 0
  329. !
  330. ! @ANSWER for PowerPort BRONZE
  331. ! Set up the modem to answer
  332. !
  333. @LABEL 100
  334. write "ATS0=1\13"
  335. matchclr
  336. matchstr 1 101 "OK\13\10"
  337. matchread 30
  338. jump 59
  339. !
  340. @LABEL 101
  341. matchstr  1 77 "RING\13\10"
  342. matchstr  2 72 "CONNECT 1200\13\10"
  343. matchstr  3 73 "CONNECT 2400\13\10"
  344. matchstr  4 50 "NO CARRIER\13\10"
  345. matchstr  5 50 "ERROR\13\10"
  346. matchstr  6 52 "NO DIALTONE\13\10"
  347. matchstr  7 53 "BUSY\13\10"
  348. matchstr  8 54 "NO ANSWER\13\10"
  349. matchread 700
  350. jump 101
  351. !
  352. @LABEL 77
  353. userhook 1
  354. note "Answering phone..." 2
  355. jump 101
  356. !